
































;--------------------------------
;Include Modern UI

  !include "MUI2.nsh"
  
  !include "FileFunc.nsh"


;--------------------------------
;General

  ;Name and file
  Name "Weltweitimnetz Browser Beta 0.15"
  OutFile "inst.exe"

  ;Default installation folder
  InstallDir "$LOCALAPPDATA\Weltweitimnetz\Browser"
  
  ;Get installation folder from registry if available
  InstallDirRegKey HKCU "Software\Weltweitimnetz\Browser\Inst" ""

  ;Request application privileges for Windows Vista
  RequestExecutionLevel user

;--------------------------------
;Interface Settings

  !define MUI_ABORTWARNING
  
  !define MUI_FINISHPAGE_RUN "$INSTDIR\WeltweitimnetzBrowser.exe"
  
;--------------------------------
;Pages
  !insertmacro MUI_PAGE_WELCOME
  
  !insertmacro MUI_PAGE_COMPONENTS
  
  !insertmacro MUI_PAGE_DIRECTORY
  
  !insertmacro MUI_PAGE_INSTFILES
  
  !insertmacro MUI_UNPAGE_CONFIRM
  !insertmacro MUI_UNPAGE_INSTFILES
  
  !insertmacro MUI_PAGE_FINISH
  


;--------------------------------
;Languages
 
  !insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "!Weltweitimnetz Browser"
  
  RMDir /r "$INSTDIR"

  ; write uninstall strings
  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\WeltweitimnetzBrowser" "DisplayName" "Weltweitimnetz Browser (remove only)"
  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\WeltweitimnetzBrowser" "UninstallString" '"$INSTDIR\Uninstall.exe"'



  SetOutPath "$INSTDIR"
  
  ;ADD YOUR OWN FILES HERE...
  
  File /r ..\BrowserPack\*.*

  ;Store installation folder
  WriteRegStr HKCU "Software\Weltweitimnetz\Browser\Inst" "" $INSTDIR
  
  ;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.exe"

    ;Create shortcuts
    CreateDirectory "$SMPROGRAMS\Weltweitimnetz"
    ;CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
    CreateShortCut "$SMPROGRAMS\Weltweitimnetz\Browser.lnk" "$INSTDIR\WeltweitimnetzBrowser.exe"
    CreateShortCut "$SMPROGRAMS\Weltweitimnetz Browser.lnk" "$INSTDIR\WeltweitimnetzBrowser.exe"
    CreateShortCut "$DESKTOP\Weltweitimnetz Browser.lnk" "$INSTDIR\WeltweitimnetzBrowser.exe" 



   /* WriteRegStr HKCU "Software\Classes\htmlfile" "" "Web Document"
    WriteRegStr HKCU "Software\Classes\htmlfile\shell" "" "OpenInWeltweitimnetzBrowser"
    WriteRegStr HKCU "Software\Classes\htmlfile\shell\OpenInWeltweitimnetzBrowser\command" "" '"$INSTDIR\WeltweitimnetzBrowser.exe" "%1"'
    WriteRegStr HKCU "Software\Classes\htmlfile\DefaultIcon" "" "$INSTDIR\WeltweitimnetzBrowser.exe,1"
      */


    ${RefreshShellIcons}

SectionEnd



Section /o "Built-In Portable Flash Player (only install if necessary !!!)" SecFlash

  SetOutPath "$INSTDIR"

  File /r ..\BrowserPackFlash\*.*

SectionEnd


;--------------------------------
;Descriptions
  ;Assign language strings to sections
  ;!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
    ;!insertmacro MUI_DESCRIPTION_TEXT ${SecProgram} $(SecProgram)
  ;!insertmacro MUI_FUNCTION_DESCRIPTION_END
 
;--------------------------------
;Uninstaller Section

Section "Uninstall"

  ;ADD YOUR OWN FILES HERE...
  DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\WeltweitimnetzBrowser"

  RMDir /r "$INSTDIR"

  Delete "$SMPROGRAMS\Weltweitimnetz\Browser.lnk"
  Delete "$DESKTOP\Weltweitimnetz Browser.lnk"
  Delete "$SMPROGRAMS\Weltweitimnetz Browser.lnk"
  RMDir "$SMPROGRAMS\Weltweitimnetz"
  
  DeleteRegKey HKCU "Software\Weltweitimnetz\Browser"
  
SectionEnd